<?php

namespace pUtils;

use Throwable;

class config {
    
    //读取全局设置
    public static function get(...$keys) {
        try {
            $configFile = __DIR__ . '/../config.xml';
            $xmlContent = file_get_contents($configFile);
            $xmlString  = simplexml_load_string($xmlContent);
            $xmlJson    = json_encode($xmlString);
            
            return utils::getVal(json_decode($xmlJson, true), ...$keys);
        } catch (Throwable) {
            // return $th->getMessage();
            return null;
        }
    }
}